package com.application.tourapp;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

/**
 * Cette classe resrsente l'ecran des carte GoogleMaps API V2
 * 
 * @author Islam
 *
 */

public class ItemMapActivity extends FragmentActivity {

	private GoogleMap map;

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		final String itemLng = getIntent().getStringExtra("lng_item");
		final String itemLat = getIntent().getStringExtra("lat_item");
		setContentView(R.layout.map_item_activity);
		FragmentManager myFM = getSupportFragmentManager();
		SupportMapFragment myMAPF = (SupportMapFragment) myFM
				.findFragmentById(R.id.map);
		map = myMAPF.getMap();
		Marker marker = map.addMarker(new MarkerOptions().position(
				new LatLng(Double.parseDouble(itemLat), Double
						.parseDouble(itemLng))).title("Egypte"));
		map.moveCamera(CameraUpdateFactory.newLatLngZoom(marker.getPosition(),
				10));
	}
}
